package com.boss.kafka.message;

import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Processor;
import org.springframework.messaging.handler.annotation.SendTo;

/**
 * Created by xuxiaobao on 2017/12/11.
 */
@EnableBinding(value = {Processor.class})
public class SinkReceiver {

    @StreamListener(Processor.OUTPUT)
    @SendTo(Processor.INPUT)
    public Object outMessage(Object obj) {
        System.out.println(obj);
       return "receive "+obj;
    }

    @StreamListener(Processor.INPUT)
    public void out(Object obj) {
        System.out.println(obj);
    }

}
